var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index' , { title: 'Express' });
});
router.get('/search', function(req, res, next) {


    if(req.cookies.userInfo!=null&&req.cookies.userInfo.user!=""){

        res.render('search' , { title: 'Express' });

    }else {

        res.render("index",{title:"Ex"});
    }
});

router.get("/login",function (req,res,next) {

    res.render("login", { title: 'Express' });


});

router.get("/manager",function (req,res,next) {

    res.render("manager", { title: 'Express' });

});

router.get("/adm",function (req,res,next) {

    if(req.cookies.userInfo!=null&&req.cookies.userInfo.user!=""){

        res.render('amd' , { title: 'Express' });

    }else {

        res.render("index",{title:"Ex"});
    }
});
module.exports = router;
